package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile string `json:"mobile"`
	Img    string `json:"img"`
	State  int64  `json:"state"`
}

func (u *User) UpdateImg(UserId int, img string) error {
	return DB.Debug().Model(&User{}).Where("id = ?", UserId).Update("img", img).Error
}
func (u *User) UserList(State int) (list []*User, err error) {
	err = DB.Debug().Where("state = ?", State).Find(&list).Error
	return list, err
}
